<?php
/**
 * MatchDart! is a darts event ranking table component for joomla
 * 
 * @version		2.0.1 | $Id: view.html.php 106 2009-08-30 18:03:21Z mwi.nor $
 * @package		MatchDart!
 * @subpackage	Admin
 * @copyright	Copyright (C) 2005 - 2009 Marco Wilde. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * @author		Marco Wilde, <mailto://info@matchdart.de>
 * @link		http://www.matchdart.de
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

class MatchdartViewMatch extends JView
{

    public function display($tpl = null)
    {
    	

        $word        =& $this->get('Data');
        $isNew        = ($word->MatchID < 1);

        $text = $isNew ? JText::_( 'New' ) : JText::_( 'Edit' );
        JToolBarHelper::title(   JText::_( 'MD_MATCH' ).': <small><small>[ ' . $text.' ]</small></small>', 'matchdart' );
        JHTML::_('stylesheet', 'matchdart.css', 'administrator/components/com_matchdart/css/');
        //JToolBarHelper::save();
        if ($isNew)  {
            //JToolBarHelper::cancel();
        } else {
            // for existing items the button is renamed `close`
            //JToolBarHelper::cancel( 'cancel', 'Close' );
        }
        
        $eventdata = $this->get('EventData');
        $this->assignRef('eventdata', $eventdata);
        
        $eventselect = $this->get('EventSelect');
        $this->assignRef('eventselect', $eventselect);
        
        $seasonselect = $this->get('SeasonSelect');
        $this->assignRef('seasonselect', $seasonselect);

        $venueselect = $this->get('VenueSelect');
        $this->assignRef('venueselect', $venueselect);
        
        $matchTypeSelect = $this->get('MatchTypeSelect');
        $this->assignRef('matchTypeSelect', $matchTypeSelect);
        
        $homePlayerSelect = $this->get('HomePlayerSelect');
        $this->assignRef('homePlayerSelect', $homePlayerSelect);
        
        $awayPlayerSelect = $this->get('AwayPlayerSelect');
        $this->assignRef('awayPlayerSelect', $awayPlayerSelect);
        
        $hometeamselect = $this->get('HomeTeamSelect');
        $this->assignRef('hometeamselect', $hometeamselect);
        
        $awayteamselect = $this->get('AwayTeamSelect');
        $this->assignRef('awayteamselect', $awayteamselect);

        $calendar = $this->get('MatchCalendar');
        $this->assignRef('calendar', $calendar);
        
        
        $this->assignRef('match', $word);
        parent::display($tpl);
    }
}
?>